Finding the domain and range of a function